import { createRequestWithPrefix } from '../axios.js';

const requestEmail = (...args) => {
  return createRequestWithPrefix('email')(...args)
    .then(({ data }) => data);
};
async function send({ email }) {
  return requestEmail('post', '/send', { email });
}

async function verify({ email, code }) {
  return requestEmail('post', '/verify', {
    email, code
  });
}

export {
  send,
  verify
};
